var gulp = require('gulp');
var ts = require('gulp-typescript');
var tsProject = ts.createProject('tsconfig.json');
var browserify = require("browserify");
var source = require('vinyl-source-stream');
var tsify = require("tsify");
jade = require('gulp-jade');
var wiredep = require('wiredep').stream;

var paths = {
    pages: ['packages/hello-world/panel/*.html']
};

gulp.task("copy-html", function () {
    return gulp.src(paths.pages)
        .pipe(gulp.dest("packages/hello-world/panel/"));
});

// gulp.task("default", gulp.series(
//     "copy-html", function () {
//         return browserify({
//             basedir: '.',
//             debug: true,
//             entries: ['test/mocha/launch.test.ts'],
//             cache: {},
//             packageCache: {}
//         })
//         .plugin(tsify)
//         .bundle()
//         .pipe(source('bundle.js'))
//         .pipe(gulp.dest("packages/hello-world/panel/"));
//     }
// ));

gulp.task('default', function(){
    const src = './preview-templates/index.jade';
    dist = './preview-templates';

    return gulp.src(src)
    .pipe(jade())
    .pipe(gulp.dest(dist));
});